package com.tiancheng.trade.settlement.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Optional;

/**
 * @Auther: liuzhonghu
 * @Date: 2024/4/3 16:00
 * @Param ${tags}
 * @Description:
 */
@Getter
@AllArgsConstructor
public enum StatementProjectNameEnum {

    //成本/差异项目名称 1应收金额 2核销金额 3实收金额 4交易差异 5平台服务费 6结算价格 7不含税成本 8税额 9银行资金(￥) 10资金差异(￥)
    RECEIVABLE("1", "应收金额"),
    WRITE_OFF("2", "核销金额"),
    RECEIPTS("3", "实收金额"),
    TRANSACTION("4", "交易差异"),
    PLATFORM("5", "平台服务费"),
    SETTLEMENT("6", "结算价格"),
    COST("7", "不含税成本"),
    TAX_AMOUNT("8", "税额"),
    BANK_CAPITAL("9", "银行资金(￥)"),
    CAPITAL_DIFF("10", "资金差异(￥)"),
    BANK_STATEMENT("11", "无交易订单银行流水(￥)"),
    LIQUIDATION_FUNDS("12", "无交易订单清算资金(￥)");

    private String code;
    private String desc;

    public static String getDesc(String code) {
        Optional<StatementProjectNameEnum> found = Arrays.stream(StatementProjectNameEnum.values()).filter(c -> c.code.equals(code)).findFirst();
        if (found.isPresent()) {
            return found.get().getDesc();
        }
        return "";
    }
}
